package yxy.game.pm2.module.chibi;

import java.util.Collection;

import org.joda.time.DateTimeConstants;

import yxy.game.pm2.bean.area.AreaBean;
import yxy.game.pm2.bean.timeline.FutureRunnable;

public class ChibiFuture extends FutureRunnable {

	@Override
	public void init() {
		handle();
	}

	@Override
	public void tick() {
		handle();
	}

	@Override
	public long period() {
		return DateTimeConstants.MILLIS_PER_MINUTE * 5;// 5分钟一刷
	}

	private void handle() {
		try {
			Collection<AreaBean> all = AreaBean.all();
			for (AreaBean areaBean : all) {
				RankChibi rank = new RankChibi(areaBean);
				rank.updatetime();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
